home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / DATAUTIL / DBASEUT1.LZH / DWTDATA.PRG < prev    next >
Text File  |  1985-09-08  |  9KB  |  230 lines

  1. * dwtdata.prg *
  2. * main = dwt
  3.  
  4. do while .t.
  5.   * display screen *
  6.   @ 01,00 say '▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒'
  7.   @ 02,00 say '▒▒ ╔═══════════════╗ ▒▒ ╔══════════════════════════════════════════════════╗ ▒▒'
  8.   @ 03,00 say '▒▒ ║ DATA BASE     ║ ▒▒ ║                                                  ║ ▒▒'
  9.   @ 04,00 say '▒▒ ╟───────────────╢ ▒▒ ║              Customer Master File                ║ ▒▒'
  10.   @ 05,00 say '▒▒ ║ Help          ║ ▒▒ ║  ┌────────────────────────────────────────────┐  ║ ▒▒'
  11.   @ 06,00 say '▒▒ ║ Update        ║ ▒▒ ║  │Customer name.....                          │  ║ ▒▒'
  12.   @ 07,00 say '▒▒ ║               ║ ▒▒ ║  │Customer number...                          │  ║ ▒▒'
  13.   @ 08,00 say '▒▒ ║               ║ ▒▒ ║  └────────────────────────────────────────────┘  ║ ▒▒'
  14.   @ 09,00 say '▒▒ ║               ║ ▒▒ ║                                                  ║ ▒▒'
  15.   @ 10,00 say '▒▒ ║               ║ ▒▒ ║  ┌────────────────────────────────────────────┐  ║ ▒▒'
  16.   @ 11,00 say '▒▒ ║               ║ ▒▒ ║  │Address...........                          │  ║ ▒▒'
  17.   @ 12,00 say '▒▒ ║               ║ ▒▒ ║  │Address...........                          │  ║ ▒▒'
  18.   @ 13,00 say '▒▒ ║               ║ ▒▒ ║  │City, State, Zip..                          │  ║ ▒▒'
  19.   @ 14,00 say '▒▒ ║ ─┘ to quit   ║ ▒▒ ║  │Telephone.........                          │  ║ ▒▒'
  20.   @ 15,00 say '▒▒ ╚═══════════════╝ ▒▒ ║  │Comments:                                   │  ║ ▒▒'
  21.   @ 16,00 say '▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ║  └────────────────────────────────────────────┘  ║ ▒▒'
  22.   @ 17,00 say '▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ║                                                  ║ ▒▒'
  23.   @ 18,00 say '▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ║                                                  ║ ▒▒'
  24.   @ 19,00 say '▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ║                                                  ║ ▒▒'
  25.   @ 20,00 say '▒▒ ╔═══════════════╗ ▒▒ ║                                                  ║ ▒▒'
  26.   @ 21,00 say '▒▒ ║               ║ ▒▒ ║                                                  ║ ▒▒'
  27.   @ 22,00 say '▒▒ ╚═══════════════╝ ▒▒ ╚══════════════════════════════════════════════════╝ ▒▒'
  28.   @ 23,00 say '▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒'
  29.  
  30.   * prompt for action *
  31.   store ' ' to action
  32.   @ 21,05 say 'Selection?'get action picture 'A'
  33.   read
  34.   clear gets
  35.   @ 21,04 say '               '
  36.   store UPPER(action) to action
  37.  
  38.   * go for case *
  39.   do case
  40.  
  41.       * quit and repaint background *
  42.     case action='Q' .or. action=' '
  43.       return
  44.  
  45.       * display help screen *
  46.     case action='H'
  47.       @ 21,04 say ' Stand by...   '
  48.       @ 03,10 say '╔═════════════════════════════════════════════════════════╗'
  49.       @ 04,10 say '║ d/WT may be configured to meet your own specifications  ║'
  50.       @ 05,10 say '║ by simply using this system of command files as a pat-  ║'
  51.       @ 06,10 say '║ tern for new applications.                              ║'
  52.       @ 07,10 say '║                                                         ║'
  53.       @ 08,10 say "║ Press 'U' to update this example data base. If a key is ║"
  54.       @ 09,10 say '║ not found d/WT will ask if you wish to add the new key  ║'
  55.       @ 10,10 say '║ to the data base. If the key is found, d/WT will dis-   ║'
  56.       @ 11,10 say '║ play the record, and ask if you want to edit the infor- ║'
  57.       @ 12,10 say '║ mation located.                                         ║'
  58.       @ 13,10 say '║                                                         ║'
  59.       @ 14,10 say "║ Press <CR> to abort any function at any time.           ║"
  60.       @ 15,10 say '║                                                         ║'
  61.       @ 16,10 say '║                                                         ║'
  62.       @ 17,10 say '╚═════════════════════════════════════════════════════════╝'
  63.  
  64.       * prompt to continue *
  65.       store ' ' to continue
  66.       @ 21,05 say 'Any key...' get continue
  67.       read
  68.       clear gets
  69.       @ 21,04 say ' Stand by...   '
  70.  
  71.       * update *
  72.     case action='U'
  73.       select 1
  74.       * display file and date window *
  75.       store .t. to control
  76.       do while control
  77.  
  78.         * display option panel *
  79.         @ 05,05 say 'Upper case or'
  80.         @ 06,05 say ' lower case  '
  81.         @ 07,05 say ' is permitted'
  82.         @ 08,05 say '             '
  83.         @ 09,05 say '             '
  84.  
  85.         * prompt for key *
  86.         store '                        ' to keym
  87.         @ 21,04 say ' Enter key...  '
  88.         @ 06,46 get keym picture 'XXXXXXXXXXXXXXXXXXXXXXXX'
  89.         read
  90.         clear gets
  91.         @ 21,04 say '               '
  92.  
  93.         * done? *
  94.         if SUBSTR(keym,1,1)=' '
  95.           @ 21,04 say ' Stand by...   '
  96.           store .f. to control
  97.           loop
  98.           loop
  99.         endif
  100.  
  101.         * get key requested *
  102.         store trim(UPPER(keym)) to keym
  103.         find &keym
  104.  
  105.         * if not found *
  106.         if (EOF() .OR. BOF())
  107.           @ 09,10 say '╔════════════════════════════╗'
  108.           @ 10,10 say '║                            ║'
  109.           @ 11,10 say '║                            ║'
  110.           @ 12,10 say '╚════════════════════════════╝'
  111.           @ 10,13 say keym
  112.           store ' ' to action
  113.           @ 11,13 say "Doesn't exis, add? (y/n) " get action picture 'A'
  114.           read
  115.           clear gets
  116.           store UPPER(action) to action
  117.           @ 09,00 say '▒▒ ║               ║ ▒▒ ║               '
  118.           @ 10,00 say '▒▒ ║               ║ ▒▒ ║  ┌────────────'
  119.           @ 11,00 say '▒▒ ║               ║ ▒▒ ║  │Address.....'
  120.           @ 12,00 say '▒▒ ║               ║ ▒▒ ║  │Address.....'
  121.  
  122.           * if addition is desired *
  123.           if action='Y'
  124.             appe blank
  125.             replace key with keym
  126.           else
  127.             loop
  128.           endif
  129.         else
  130.           store key to keym
  131.  
  132.           * display record *
  133.           @ 06,46 say '                        '
  134.           @ 06,46 say keym
  135.           @ 07,46 say custnumb
  136.           @ 11,46 say addr1
  137.           @ 12,46 say addr2
  138.           @ 13,46 say city
  139.           @ 14,46 say phone picture '(999) 999-9999'
  140.           @ 15,37 say comments
  141.  
  142.           * display option panel *
  143.           if DELETE()
  144.             @ 05,05 say 'Recall       '
  145.             @ 06,05 say '             '
  146.           else
  147.             @ 05,05 say 'Edit         '
  148.             @ 06,05 say 'Delete       '
  149.           endif
  150.           @ 07,05 say '             '
  151.           @ 08,05 say '             '
  152.           @ 09,05 say '             '
  153.  
  154.           * show deleted record *
  155.           if DELETE()
  156.             @ 09,10 say '╔════════════════════════════╗'
  157.             @ 10,10 say '║                            ║'
  158.             @ 11,10 say '║                            ║'
  159.             @ 12,10 say '╚════════════════════════════╝'
  160.             @ 10,12 say keym
  161.             @ 11,12 say "** MARKED FOR DELETION **" 
  162.           endif
  163.  
  164.           * prompt for action *
  165.           store ' ' to action
  166.           @ 21,04 say ' Selection? ' get action picture 'A'
  167.           read
  168.           clear gets
  169.           store UPPER(action) to action
  170.  
  171.           * recall record *
  172.           if action='R'
  173.             recall
  174.           endif
  175.  
  176.           if DELETE()
  177.             store ' ' to action
  178.           endif
  179.  
  180.           * mark record for deletetion *
  181.           if action='D'
  182.             delete
  183.           endif
  184.  
  185.           @ 21,04 say ' Stand by...   '
  186.         endif 
  187.  
  188.         * get input screen *
  189.         if action='Y' .or. action='E'
  190.  
  191.           * display option panel *
  192.           @ 05,05 say 'CTRL Q to    '
  193.           @ 06,05 say ' abandon...  '
  194.           @ 07,05 say '             '
  195.           @ 08,05 say 'CTRL W to    '
  196.           @ 09,05 say ' save...     '
  197.           @ 14,05 say '             '
  198.  
  199.           @ 21,04 say ' Editing...    '
  200.           @ 06,46 say keym
  201.           @ 07,46 get custnumb
  202.           @ 11,46 get addr1
  203.           @ 12,46 get addr2
  204.           @ 13,46 get city
  205.           @ 14,46 get phone picture '(999) 999-9999'
  206.           @ 15,37 get comments
  207.           read
  208.           clear gets
  209.           @ 21,04 say ' Stand by...   '
  210.         endif 
  211.  
  212.         * clear data path *
  213.         @ 06,46 say '                        '
  214.         @ 07,46 say '          '
  215.         @ 11,46 say '                        '
  216.         @ 12,46 say '                        '
  217.         @ 13,46 say '                        '
  218.         @ 14,46 say '              '               
  219.         @ 15,37 say '                              '
  220.         @ 09,00 say '▒▒ ║               ║ ▒▒ ║               '
  221.         @ 10,00 say '▒▒ ║               ║ ▒▒ ║  ┌────────────'
  222.         @ 11,00 say '▒▒ ║               ║ ▒▒ ║  │Address.....'
  223.         @ 12,00 say '▒▒ ║               ║ ▒▒ ║  │Address.....'
  224.     enddo
  225.   endcase
  226. enddo
  227.  
  228.  
  229.  
  230.